﻿@{
    ViewBag.Title = "Index";
}


<script type="text/javascript">
    $(function () {
  
        message();
        $("#log").click(function () {
            var tel = $("#tel");
            var password = $("#password");
            if ($.trim(tel.val()) == "") {
                var n = noty({
                    text: '手机号不允许为空!'
                  //  theme: 'your_new_theme',
                });
                tel.focus();
                return false;
            }
            if ($.trim(password.val()) == "") {
                var n = noty({
                    text: '密码不允许为空!'
                    //  theme: 'your_new_theme',
                });
                password.focus();
                return false;
            }
            $.mobile.loading("show", {
                text: "登录中....",
                textVisible: true,
                theme: "b"
            });
            $.post("/Login/LoginWX", $("#loginfo").serialize(), function (data) {
                $.mobile.loading("hide");
                if (data != null) {
                    if (data.message == "") {
                        var url = data.def ? "/User/UpdatePasswordView?pan=def" : "/Common/Dialog";
                        window.location.replace(url);
                        // $.mobile.changePage("Common/Dialog");
                    }
                    else {
                        noty({text:data.message});
                    }
                }
            });
        });
    })
</script>


<div data-role="page">
    <div data-role="header" data-theme="b">
        <h1>微信预约</h1>
    </div>
    <div data-role="content">
        <form id="loginfo">
            <div class="ui-grid-a">
                <div class="ui-block-a " style=" width: 25%; height: 54px; line-height: 54px; text-align: center;">手机号：</div>
                <div class="ui-block-b" style="width:75%">
                    <input type="number" data-clear-btn="true" name="tel" id="tel" value="@ViewBag.telmessage" />
                </div>
            </div>
            <div>
                <div class="ui-block-a" style=" width: 25%; height: 54px; line-height: 54px; text-align: center;">
                    密  码：
                </div>
                <div class="ui-block-b" style="width:75%">
                    <input data-clear-btn="true" name="password" id="password" value="" type="password" />
                </div>
            </div>
            <button class="ui-btn ui-corner-all" style="background-color:blanchedalmond" id="log" type="button" rel="external">登录</button>
        </form> 
    </div>
</div>
